package br.com.pattern.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionDataBaseMySQL extends ConnectionDataBaseGeneric{

	private static final String URL_MYSQL = "jdbc:mysql://localhost:3306/scvpi";
	private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";
	private static final String USER = "root";
	private static final String PASS = "123";
	
	@Override
	public Connection getConnection() {
		
		System.out.println("Conectando ao Banco de Dados MySQL...");

		try {		
			Class.forName(DRIVER_CLASS);
			this.connection = DriverManager.getConnection(URL_MYSQL, USER, PASS);
			return this.connection;

		} catch (ClassNotFoundException e) {		
			e.printStackTrace();

		} catch (SQLException e) {		
			throw new RuntimeException(e);		
		}

		return null;
	}

}
